import request from '@/utils/http'

// 获取众筹详情
export function getProjectInfoAPi(id) {
  return request({
    url: '/project/selectProjectById',
    method: 'get',
    params: { id }
  })
}

// 根据加工厂id获取众筹列表
export function getCrowdfundingListAPI(factoryId) {
  return request({
    url: '/project/selectProjectByFactoryId',
    method: 'get',
    params: { factoryId }
  })
}

// 发起众筹
export function addCrowdFundingAPI(data) {
  return request({
    url: '/project/insertProject',
    method: 'post',
    data: data
  })
}

// 编辑众筹
export function editCrowdFundingAPI(data) {
  return request({
    url: '/project/updateProject',
    method: 'put',
    data: data
  })
}